﻿/*
{
"状态":1,
"名称":"删除-用户部门信息",
"作者":"陈泽椿",
"创建时间":"2018-06-30",
"功能":"删除-用户部门信息",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/

declare @sql varchar(max)
declare @keys varchar(max)
declare @department_key int
set @department_key = '{department_key}'
set @keys = '{keys}'

set @sql = 'delete y_department_user where 1=1 and department_key = '+convert(varchar,@department_key)+' and user_key in ({ids})'

set @sql =REPLACE(@sql,'{ids}',@keys)

exec(@sql)